The present invention relates to a virtual image generation technique for use in game units, simulators, and the like, and particularly to a technique for generating images calculating and processing data in a three-dimensional space by projecting the generated three-dimensional data onto a two-dimensional plane from a view point so as to generate image data to be displayed on the monitor screen and the obtained data is converted to two-dimensional data.
In recent years, game units and simulators equipped with on-board virtual image generation apparatuses which make it possible to display images of objects that move through three-dimensional natural virtual space in response to manual control by a game player such as in a; combat have been developed. Such virtual image generation apparatuses are usually equipped with a virtual image generation apparatus main unit that houses a computer unit for executing stored programs, an input device for sending control signals to the computer unit to instruct it to move objects displayed on the screen within the virtual image, a display for displaying the virtual images generated by the computer unit according to the program sequence, and a sound device for generating sounds according to the program sequence.
Examples of game devices with the architecture described above include those with a combat theme in which a player-controlled object (robot, human, or the like) engages in combat with enemy objects with which the player fights over a terrain created in virtual space (hereinafter termed xe2x80x9cvirtual terrainxe2x80x9d). The objects controlled by the player in such game units attack enemies by shooting at them while hiding behind the obstacles and the like which are provided as part of the virtual terrain.
In order to enable three-dimensional display of motion within the virtual space, an image like that perceived when the virtual space is observed from a prescribed visual point is used. This is accomplished using coordinate conversion for perspective projection, whereby a coordinate system for the virtual space is represented in perspective from a prescribed visual point and projected onto a two-dimensional plane lying in front of the visual point. In many cases, the line of sight which extends from the visual point of the virtual image is oriented towards the player""s object so that the object controlled by the player is visible to the player. The object controlled by the player is displayed as a subject located nearlly at the center of the display.
However, since the position relationship between the visual point of the virtual image and the player""s object is fixed during movement, obstacles sometimes block the line of sight which extends towards the player""s object. In such cases, the player""s object is obscured by the obstacle, making it difficult for the player to see the movements of the object and making it difficult to control the object. The loss of ability to control the player""s object diminishes the excitement of the game, making the game uninteresting.
Such a case will be described making reference to FIG. 6. When a subject Rxe2x80x2 is observed by a virtual camera Cxe2x80x2, which serves as the visual point for the virtual image in question, position relationships are sometimes such that the line of sight is blocked by an obstacle O, as shown in FIG. 6A. When the line of sight is so obscured, the subject R is displayed obscured by the obstacle O in the generated virtual image, as shown in FIG. 6B. Thus, the player can no longer determine how best to control the subject Rxe2x80x2 which is the object of control.
In order to avoid such occurrences, it is possible, for example to:
(1) not display obstacles; or
(2) display the obstacles with wire frames from the beginning.
However, adopting methods such as (1) produces a new problem in that, while the player""s object is visible, obstacles are not visible. Adopting methods such as (2) makes it possible to see obstacles, but since obstacles are displayed with wire frames even when the subject R is not hidden by obstacles O, the look of the game suffers.
In order to solve such problems, the present invention is intended to provide a virtual image generation apparatus that does not employ the aforementioned methods (1) and (2), and that affords a game that does not suffer from impaired look. Another object of the present invention is to provide a virtual image generation apparatus that correctly determines whether a subject can be displayed overlapping a physical object in virtual space, and which performs appropriate transparent processing to make both the subject and physical object visible, and to a method therefor.
In order to achieve these objects, the present invention provide a virtual image generation method for generating virtual images (game images, simulation images, and the like) of subjects (player-controlled robots, airplanes, or other objects) present in a virtually defined virtual space (for example, a space described by a world coordinate system) and observed from a prescribed visual point (such as diagonally above the subject, as viewed from the vertical relationship in the virtual space), comprising the steps of determining whether certain prescribed conditions are fulfilled on the basis of shape data (polygon data, data specifying shape position, surface data, and the like) pertaining to physical objects (virtual terrain, obstacles, irregular terrain surfaces, and the like) present in the virtual space, and position data (coordinate data and the like) for a subject, for example, determining whether a physical object located between the visual point and the subject should overlap and be visible from the visual point, generating virtual images in which a physical object is subjected to prescribed show-through processing (mesh processing, translucent processing, wire frame depiction of the physical object, or the like) in the event that it is determined that the subject and physical object are disposed in a prescribed overlapping state, or performing non-show-through processing (ordinary texture data application processing or the like) in which the physical object is not rendered show-through in the event that it is determined that the subject and physical object are disposed in a state other than a prescribed overlapping state.
In accordance with one aspect of the present invention there is a provided a virtual image generation apparatus which generates within a virtually defined virtual space virtual images of the below mentioned subjects, physical objects, and other figures present in said virtual space as they would be observed from a prescribed visual point, while rendering said images show-through or non-show-through, comprising virtual image generation means for rendering said non-show-through images into show-through images when prescribed conditions have been fulfilled, and rendering the show-through images into non-show-through images when said prescribed conditions are no longer fulfilled.
In accordance with another aspect of the present invention there is a provided a virtual image generation apparatus comprising shape data memory means for storing shape data pertaining to physical objects present in said virtual space, position data specification means for specifying position data for said subjects, overlap determination means for determining, on the basis of said shape data stored in said shape data memory means and position data for said subjects specified by said position data specification means, whether or not said physical object located between said visual point and said subject should overlap and be visible from said visual point, and image generation means for generating virtual images wherein said physical object is processed by prescribed show-through processing in the event that said overlap determination means has determined that said subject and said physical object are disposed in a prescribed overlapping state, and for generating virtual images wherein said physical object is processed by non-show-through processing and is not rendered show-through in the event that said subject and said physical object are disposed in a state other than a prescribed overlapping state.
In accordance with one aspect of the present invention, the overlap determination means computes a first vector which extends in direction in which said subject is observed from said visual point, and a second vector which extends from said physical object towards said subject, computes the angle formed by this first vector and second vector, and, in the event that this angle falls within a prescribed relationship with regard to a prescribed reference angle, decides that an overlapping state exists, or, in the event that the angle falls outside the prescribed relationship, decides that non-overlapping state exists. Favorably, the angle formed by this first vector and second vector is compared with a prescribed reference angle; when this angle is smaller than said reference angle, it is decided that an overlapping state exists, and when said angle is greater than said reference angle, it is decided that a non-overlapping state exists.
Said angle is, for example, the angle formed when the vectors are projected onto a prescribed coordinate plane. Said reference angle is selected, for example, with a size sufficient to permit a determination as to whether the two vectors are facing in essentially the same direction to be made.
In a further aspect of the present invention there is provided a virtual image generation apparatus, wherein the overlap determination means compares displacement (displacement in the y axis direction, i.e., height, or the like) from a prescribed ground point (the x-z plane in a world coordinate system or the like) for a first reference point (the bottom edge, geometric center of gravity, or other point on the exterior of a subject) previously specified for a subject with displacement (physical object height, or the like) from a ground point for a second reference point (physical object top edge, geometric center, or the like) previously specified for a physical object, and, in the event that the displacement for the first reference point is smaller than the displacement for the second reference point, decides that an overlapping state exists, or, in the event that the displacement for the first reference point is greater than the displacement for the second reference point, decides that a non-overlapping state exists.
In still another aspect of the present invention, the above described overlap determinations may be used concomitantly, and the decision that an overlapping state exists made contingent upon both decision conditions being fulfilled.
In a further aspect of the invention, there is provided a virtual image generation apparatus, wherein for show-through display, the image generation means generates a virtual image by displaying pixels for displaying a subject in accordance with a prescribed pattern (a pattern in which a pixel is replaced every few dots, a striped pattern, or the like), rather than pixels for displaying a physical object. In a further aspect of the invention, there is provided a virtual image generation apparatus wherin the pattern comprises an alternating sequence of pixels for displaying a physical object and pixels for displaying a subject.
In accordance with the present invention, obstacles and other physical objects which are displayed without show-through processing are, when certain prescribed conditions are fulfilled (for example, when a physical object comes between a visual point and a subject, as observed from the visual point), processed by show-through treatment; when these conditions no longer apply, physical object image generation returns to non-show-through processing.
Usually, when a physical object comes in front of a subject observed from the visual point, the subject is obscured by the physical object with the result that the subject image is not sufficiently visible to the viewer of the virtual image. Faced with a state wherein a subject can be obscured by a physical object, the present invention makes a determination that an overlapping state exists and processes this physical object with show-through treatment, whereby both the obstacle and the subject images remain sufficiently visible to the viewer. As a result, the player can control the subject while staying aware of the presence of obstacles, and the look of the game does not suffer.
Where a plurality of physical objects have been determined to be in an overlapping state, show-through processing is performed for each individual physical object which has been determined to be in an overlapping state.
In the event of a position relationship such that a physical object comes between the subject and a visual point, as viewed from this particular visual point, the direction of the vector from the visual point to the subject and the vector from the physical object to the subject essentially coincide. In such a case, the angle defined by the two vectors is relatively small.
The aforementioned angle formed by the first and second vectors may be angle; thus, if the reference angle setting is made small enough to determine overlap, it may be accurately determined whether the physical object should overlap the subject.
On the other hand, taking the example of a case in which the visual point is established in a position such that the subject is observed from above, an overlapping state whereby the physical object obscures the subject when the subject is shorter than the physical object can occur.
In a further aspect of the invention, displacement of a first reference point located on a subject is compared at with displacement of a second reference point located on a physical object, that is, parameters corresponding to xe2x80x9cheightxe2x80x9d in the foregoing example. Thus, it can be determined whether the subject and physical object are disposed in a position relationship which can constitute an overlapping state. The aforementioned concomitant use of the overlapping state decision may be favorable in terms of ensuring the accuracy of the determination.
In a further aspect of the invention, show-through processing may be accomplished by replacing pixels in accordance with a prescribed pattern for display, thereby generating a virtual image in which both the physical object and the subject may be discerned. In particular, displaying a prescribed pattern by alternating physical object display pixels and aforementioned background display pixels in the manner disclosed gives a virtual image display which includes the subject without diminishing the quality of the physical object, and in which the background lying behind the physical object is clearly displayed.